//
//  RecordViewController.h
//  iHealthEHR
//
//  Created by Joseph Ayo Akinyele on 3/13/10.
//  Copyright 2010 Johns Hopkins University. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "GoogleHealth.h"
#import "DetailedViewController.h"
#import "DemViewController.h"
#import "NoticeViewController.h"
#import "MedsViewController.h"
#import "XMLParser.h"
#import "GoogleHealth.h"
#import "CPABEInterface.h"
#import "SqliteInterface.h"
@class DetailedViewController;
@class DemViewController;
@class NoticeViewController;
@class MedsViewController;

@interface RecordViewController : UITableViewController 
			<UITableViewDelegate, UITableViewDataSource, UIActionSheetDelegate, UIAlertViewDelegate>
{
	// key for mapping ccr subsections (ccrSections) which user sees
	// to the actual label on CCR XML entries (ccrCategoryKey) for identification.
	NSArray *ccrSections, *ccrCategoryKey,*ccrImageKey;
	// dictionary with profile_name => entries mapping. 
	NSMutableArray *ccrEntries, *ccrNotices, *ccrCacheImage;
	NSMutableDictionary *ccrDictEntries;
	// the type of view controller thats loaded to display the details of the medical record.
	DetailedViewController *detailedView;
	// the type of view controller that displays a portion of the demographics
	DemViewController *demographicsView;
	NoticeViewController *noticeView;
	MedsViewController *info;
	XMLParser *myXMLParser;
	GoogleHealth *googlehealth;
	CPABEInterface *cpabe;
	NSString *lastProfile; /* to handle profile switching */	
}

@property (nonatomic, retain) NSArray *ccrSections, *ccrCategoryKey, *ccrImageKey;
@property (nonatomic, retain) NSMutableArray *ccrEntries, *ccrNotices;
@property (nonatomic, retain) NSMutableDictionary *ccrDictEntries;
@property (nonatomic, retain) XMLParser *myXMLParser;
@property (nonatomic, retain) GoogleHealth *googlehealth;

-(NSString *)getItemCount:(NSString *)section;
-(NSString *) getNoticesCount;
-(NSArray *) constructCCRObjects:(NSString *)section;
// -(NSArray *) getEntryByCategory:(NSString *)section;
-(NSArray *) getNoticeArray;
-(void) logout;
-(void) myCCROptionsGH;
-(NSString *) parseDescription:(CCRObject *) object ofCCR:(NSString *) section;
@end
